s1 = {1, 2, 3}
s2 = {1, 2, 3, 2}
print(f"{s1 == s2 = }")

# add element
s1.add(1)
print(f"{s1 = }")
s1.update({6, 7})
print(f"{s1 = }")

# delete element
s2.clear()
print(f"{s2 = }, {len(s2) = }")
s1.remove(2)
s1.discard(666)
print(f"{s1 = }, {s1.pop() = }")

# immutable
fs = frozenset("abc")

# copy set
s1 = {4, 5, (1, 2)}
s2 = s1
print(f"{id(s1) == id(s2) = }")
s3 = s1.copy()
print(f"{id(s1) == id(s3) = }")

# operation
s1 = {1, 2, 3, 4}
s2 = {3, 4, 5, 6}
print(f"{s1.intersection(s2) = }, {s1&s2 = }")
print(f"{s1.union(s2) = }, {s1|s2 = }")
print(f"{s1.difference(s2) = }, {s1-s2 = }")
print(f"{s2.difference(s1) = }, {s2-s1 = }")
print(f"{s1.symmetric_difference(s2) = }, {s2.symmetric_difference(s1) = }, {s1^s2 = }")

# judge
print(f"{s1.isdisjoint(s2) = }, {s2.isdisjoint(s1) = }")
print(f"{set().issubset(s1) = }, {s1.issuperset(set()) = }")
